define(['app'],function(app){return {module: function($scope, $http, eventBusService, httpService, params) {
	
	$scope.form.status != '99';
	$scope.form.type = '1';
	$scope.saveForm = function(){
		if($scope.formCheck()){
			httpService.post(app.urls.organization_selectIfExit,$scope.form,function(data){
				if("0000" === data.code){
					if(data.data.length == 0){
						httpService.post(app.urls.organization_insert,$scope.form,function(data){
							if("0000" === data.code){
								eventBusService.publish("content.pageGroup.reload",data);
								eventBusService.publish("modal.page.close",{});
				    		}else{
				    			alert(data.msg);
				    		}
						});
					}else{
						alert("该部门已存在");
					}
	    		}else{
	    			alert(data.msg);
	    		}
			});
		}
	}
}}});